package com.yzz.hzraisedust.hzraseidust;

import android.app.Application;
import android.content.Context;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;

import com.baidu.mapapi.SDKInitializer;
import com.hik.mcrsdk.MCRSDK;
import com.hik.mcrsdk.rtsp.RtspClient;
import com.hik.mcrsdk.talk.TalkClientSDK;
import com.hikvision.sdk.VMSNetSDK;
import com.yzz.hzraisedust.hzraseidust.main.InfoActivity;
import com.yzz.hzraisedust.hzraseidust.util.CrashHandler;

/**
 * Created by zhengzhen on 2017/8/19.
 */

public class JCApplication  extends Application{

    private  static JCApplication INSTANCE;
    public static JCApplication getINSTANCE(){
        return INSTANCE;
    }
    @Override
    public void onCreate() {
        super.onCreate();
        INSTANCE = this;
        CrashHandler.getInstance().init(getApplicationContext());
        //初始化sdk
        SDKInitializer.initialize(getApplicationContext());
        //初始化视频SDK
        initMCRSDK();
    }
    private void initMCRSDK()
    {
        //MCRSDK.init();
        MCRSDK.init();
        RtspClient.initLib();
        MCRSDK.setPrint(1,null);
        TalkClientSDK.initLib();
        VMSNetSDK.init(this);
    }
    public String getMacAddress() {
        WifiManager wm = (WifiManager) getSystemService(Context.WIFI_SERVICE);
        WifiInfo connectionInfo = wm.getConnectionInfo();
        String mac = connectionInfo.getMacAddress();
        return mac == null ? "" : mac;
    }
}
